<?php

use Illuminate\Database\Seeder;

class commentData extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
		$data = [];
        for ($i=0; $i < 100; $i++) { 
        	$tem['pid'] = rand(1,100);
        	$tem['answer_id'] = rand(1,100);
        	$tem['user_id'] = rand(1,100);
        	$tem['comments_content'] = str_random(50);
        	$data[] = $tem;
        }

        //执行数据插入
        DB::table('comments')->insert($data);
    }
}
